<script setup>
import { getHomeOthertab } from '../api/home';
import { ref,onBeforeMount } from 'vue';

// const props = defineProps(['id4','type4']);
// let id = props.id4;
// let type = props.type4;
// console.log("家电=",id,type)

let electrical = ref([])

let getHomeOthertabFun = () => {
    getHomeOthertab({
        page_type:'activity',
        page_id:18642
    }).then( res =>{
        // console.log("家电的数据=>",res)
        electrical.value = res.data.data.data.sections[0].body.items.concat( res.data.data.data.sections[2].body.items, res.data.data.data.sections[4].body.items,res.data.data.data.sections[6].body.items,res.data.data.data.sections[8].body.items,res.data.data.data.sections[10].body.items );
    })
}

onBeforeMount( ()=>{
    getHomeOthertabFun()
})

</script>

<template>
    <van-loading type="spinner" color="#ff6900" v-if="!electrical" vertical/>
    <div class="electrical-page" v-else>
        <div class="electrical-pic" v-for="(item,index) in electrical" :key="index">
            <img :src="'https:'+item.img_url" alt="">
        </div>
       
    </div>
</template>

<style lang="scss">
*{
    padding: 0;
    margin: 0;
}
.electrical-page{
    width: 100%;
    height: 100vh;
    // background-color: #ffffff;
    .electrical-pic{
        width: 100%;
        height: auto;
        img{
            width: 100%;
            height: auto;
        }
    }
}

</style>